home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.42 / includes3v1 / includes3v1.lha / Exec / Libraries.i < prev    next >
Text File  |  1994-12-04  |  2KB  |  81 lines

  1.  
  2.         exec/libraries.i
  3. }
  4.  
  5. {$I "Include:exec/nodes.i" }
  6.  
  7. CONST
  8.  
  9. { ------ Special Constants --------------------------------------- }
  10.   LIB_VECTSIZE    =  6;    {  Each library entry takes 6 bytes  }
  11.   LIB_RESERVED    =  4;    {  Exec reserves the first 4 vectors  }
  12.   LIB_BASE    = (-LIB_VECTSIZE);
  13.   LIB_USERDEF    = (LIB_BASE-(LIB_RESERVED*LIB_VECTSIZE));
  14.   LIB_NONSTD    = (LIB_USERDEF);
  15.  
  16. { ------ Standard Functions -------------------------------------- }
  17.   LIB_OPEN    =  -6;
  18.   LIB_CLOSE    = -12;
  19.   LIB_EXPUNGE    = -18;
  20.   LIB_EXTFUNC    = -24;    {  for future expansion  }
  21.  
  22. TYPE
  23.  
  24. { ------ Library Base Structure ---------------------------------- }
  25. {  Also used for Devices and some Resources  }
  26.  
  27. Library = record
  28.     lib_Node  : Node;
  29.     lib_Flags,
  30.     lib_pad   : Byte;
  31.     lib_NegSize,        {  number of bytes before library  }
  32.     lib_PosSize,        {  number of bytes after library  }
  33.     lib_Version,        {  major  }
  34.     lib_Revision : Short;   {  minor  }
  35.     lib_IdString : String;  {  ASCII identification  }
  36.     lib_Sum      : Integer; {  the checksum itself  }
  37.     lib_OpenCnt  : Short;   {  number of current opens  }
  38. end;                {  * Warning: size is not a longword multiple ! * }
  39. LibraryPtr = ^Library;
  40.  
  41. CONST
  42.  
  43. {  lib_Flags bit definitions (all others are system reserved)  }
  44.  
  45.   LIBF_SUMMING = %00000001;    {  we are currently checksumming  }
  46.   LIBF_CHANGED = %00000010;    {  we have just changed the lib  }
  47.   LIBF_SUMUSED = %00000100;    {  set if we should bother to sum  }
  48.   LIBF_DELEXP  = %00001000;    {  delayed expunge  }
  49.  
  50.  
  51.  
  52. Procedure AddLibrary(lib : LibraryPtr);
  53.     External;
  54.  
  55. Procedure CloseLibrary(lib : LibraryPtr);
  56.     External;
  57.  
  58. Function MakeFunctions(target, functionarray, dispbase : Address) : Integer;
  59.     External;
  60.  
  61. Function MakeLibrary(vec, struct, init : Address;
  62.             dSize : Integer;
  63.             segList : Address) : LibraryPtr;
  64.     External;
  65.  
  66. Function OpenLibrary(libName : String; version : Integer) : LibraryPtr;
  67.     External;
  68.  
  69. Procedure RemLibrary(library : LibraryPtr);
  70.     External;
  71.  
  72. Function SetFunction(library : LibraryPtr;
  73.             funcOff : Integer;
  74.             funcEntry : Address) : Address;
  75.     External;
  76.  
  77. Procedure SumLibrary(library : LibraryPtr);
  78.     External;
  79.  
  80.